package com.biwin.module.dict.api.dto;

import com.biwin.common.app.dto.BasicBwDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * Dictionary
 *
 * @author biwin
 * @since 0.0.1
 */
@ApiModel(value = "字典信息入参对象 - DictionaryDto",
        description = "字典信息的入参对象"
)
public class DictionaryDto extends BasicBwDto {
    private static final long serialVersionUID = -5602290893279172430L;

    @ApiModelProperty("字典名称")
    @NotBlank(message = "字典名称不能为空")
    @Length(min = 2, max = 60, message = "字典名称长度范围在2-60个字符")
    private String name;

    @ApiModelProperty("字典类型")
    @NotBlank(message = "字典类型不能为空")
    @Length(min = 4, max = 60, message = "字典名称长度范围在4-60个字符")
    private String type;

    @ApiModelProperty("字典键值")
    @NotBlank(message = "字典键值不能为空")
    private String code;

    @ApiModelProperty("字典描述")
    @NotBlank(message = "字典描述不能为空")
    private String codeDesc;

    @ApiModelProperty("排序号")
    @NotNull(message = "排序号不能为空")
    @Min(value = 0, message = "排序号最小为0")
    private Integer sort = 0;

    @ApiModelProperty("启用状态 true-启用,false-禁用")
    @NotNull(message = "启用状态不能为空")
    private boolean enabled = true;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCodeDesc() {
        return codeDesc;
    }

    public void setCodeDesc(String codeDesc) {
        this.codeDesc = codeDesc;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
}
